import java.util.Objects;

public class CD extends Item{
    private String style;
    private String artist;
    public CD(String title, boolean isMine, int size,String style,String artist) {
        super(title, isMine, size);
        this.style=style;
        this.artist=artist;
    }

    @Override
    public String toString() {
        return "CD:title:"+getTitle()+";isMine:"+getIsMine()+";size:"+getSize()+";style:"+this.style+";artist:"+this.artist;
    }

    @Override
    public void print() {
        System.out.println(this);
    }

    @Override
    public boolean equals(Object obj) {
        CD cd=(CD) obj;
        return super.equals(cd)&&(Objects.equals(style, cd.style))&&(Objects.equals(artist, cd.artist));
    }
    public static void main(String[] args){
        CD cd1=new CD("a",true,5,"electro","Alan");
        CD cd2=new CD("a",true,5,"electro","Alan");
        cd1.print();
        System.out.println(cd1.equals(cd2));
    }
}
